<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="com.echo.usedsfu.entity.Information" %>
<%@ page import="com.echo.usedsfu.entity.Category" %>
<%@ page import="javax.jdo.PersistenceManager" %>
<%@ page import="com.echo.usedsfu.persistence.PMF" %>
<%@ page import="java.util.List" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">

<html>
	<head>
		<title>USED SFU</title>
		<link rel="shortcut icon" href="/images/favicon.ico">
		<link rel="Bookmark" href="/images/favicon.ico">
	    <link rel="stylesheet" href="/css/stardust/default.css" type="text/css" media="all" />
		<script type="text/javascript" src="/js/jquery-1.3.2.min.js"></script>
		<script type="text/javascript" src="/js/quickpager.jquery.js"></script>
		<script type="text/javascript">
		/* <![CDATA[ */
		$(document).ready(function() {
			$("ul.paging").quickPager();
			$("ul.paging2").quickPager({pagerLocation:"both"});
		});
		
		/* ]]> */
		</script>
		<script>
		function confirmDel(){
			if(confirm("Are U confirm?")){
				return true;
			}else return false;
		}
		</script>
		<script language="javascript">
			function fsubmit(obj){
			obj.submit();
			}
			function freset(obj){
			obj.reset();
			}
		</script>
	</head>
	<body>
	<!-- start header -->
	<div id="header-bg">
		<div id="header">
			<div id="logo">
				<h1><a href="/index.jsp">Used Staff in SFU<sup></sup></a></h1>
				<h2>Designed by FreeCSSTemplates</h2>
			</div>
			<div id="menu">
				<ul>
					<li class="active"><a href="/index.jsp">home</a></li>
					<li><a href="/postAd.jsp">Place Ad</a></li>
					<li><a href="/editAdInter.jsp">Edit Ad</a></li>
					<li><a href="/deleteAd.jsp">Delete Ad</a></li>
				</ul>
			</div>
		</div>
	</div>
	<!-- end header -->
	
	<!-- start page -->
	<div id="page">
		<!-- start content -->
		<div id="content">
			<div class="post">
				<h1 class="title">Welcome to UsedSFU</h1>
				<div class="entry">
					<p>This is a small website for used stuff exchange.</p>
				</div>
				<div class="meta">
				</div>
			</div>
			
			<div class="post">
				<ul class="paging">
				<%
					PersistenceManager pm = PMF.get().getPersistenceManager();
					String query = "select from "+ Information.class.getName();
					List<Information> infos = (List<Information>)pm.newQuery(query).execute();
					for(Information info:infos){
				%>
					<li>
					<b><%=info.getTitle() %></b><br>
					[Contact]: <%=info.getContact() %> &nbsp;&nbsp;&nbsp;[Address]:<%=info.getArea() %><br>
					[Description]:<%=info.getDescription() %><br>
					[Phone]:<%=info.getPhone() %><br>
					[Email]:<%=info.getEmail() %><br>
					[Expire Time]:<%=info.getExpire_time() %><br>
					[Image]: <%=info.getImg_id() %>
					<form action="/checkImg" method="post">
						<input type="text" name="img_id" value="<%=info.getImg_id() %>">
						<button type="submit">check image</button>
					</form>
					<div class="meta">
					</div>
					</li>
				<%} %>
				</ul>
				<div class="meta">
				</div>
			</div>
			
		</div>
			<!-- start sidebar -->
				<div id="sidebar">
				</div>
			<!-- end sidebar -->
			<div style="clear: both;">&nbsp;</div>
	</div>
	<!-- end page -->

	<!-- start footer -->
		 <%@ include file="/include/footer.jsp" %> 
	<!-- end footer -->
	</body>
</html>